{extend name="index/index"}
{block name="mycss"}
<link href="/static/index/css/pic.css" rel="stylesheet">
<link href="/static/index/css/pic1.css" rel="stylesheet">
<link href="/static/index/css/style.css" rel="stylesheet" type="text/css" media="all" />
{/block}

{block name="fjs"}
<script type="text/javascript">
    var now = new Date();
    var beginTime = now.getTime();
    var b = 1;
    var stime = "1534990869";
    setInterval(function () {
        stime++;
    }, 1000);
</script>
{/block}

{block name="main"}
<div style="background-color: red;">
</div>
{/block}

{block name="main1"}
<div  class="qv-user-box-row clearBox qv-upload">
    <div  class="user-main clearfix qv-userMain" style="background-color: #fff;background:url(/static/index/images/bj1.jpg) ">

        <!--左侧UL我的下载我的上传-->
        <ul  class="user-nav fl">
            <li  class="on mark" id="up-btn" ><a
                    class=""><i
                    class="icon-upload"></i>我的上传</a>
            </li>
            <li id="down-btn" ><a   class=""><i
                    class="icon-download"></i>我的下载</a>
            </li>
        </ul>
        <!--END左侧UL我的下载我的上传-->

        <!--下载默认隐藏部分-->
        <div id="down" data-v-bd62ee10="" class="main-container dum-main clearfix fr" style="display:none">

            <div data-v-bd62ee10="" class="dum-filter clearfix qv-dum-filter">
                <div data-v-bd62ee10="" class="dum-flag fl"><span data-v-bd62ee10="">3个月内下载</span><span data-v-bd62ee10="" class="flag-icon"><i data-v-bd62ee10=""></i></span>
                    <ul data-v-bd62ee10="" class="dum-drop">
                        <li data-v-bd62ee10=""><a data-v-bd62ee10="" href="javascript:void(0);">3个月内下载</a></li>
                        <li data-v-bd62ee10=""><a data-v-bd62ee10="" href="javascript:void(0);">今年内下载</a></li>
                        <li data-v-bd62ee10=""><a data-v-bd62ee10="" href="javascript:void(0);">2017年下载</a></li>
                        <li data-v-bd62ee10=""><a data-v-bd62ee10="" href="javascript:void(0);">2016年下载</a></li>
                        <li data-v-bd62ee10=""><a data-v-bd62ee10="" href="javascript:void(0);">2015年下载</a></li>
                        <li data-v-bd62ee10=""><a data-v-bd62ee10="" href="javascript:void(0);">2014年下载</a></li>
                        <li data-v-bd62ee10=""><a data-v-bd62ee10="" href="javascript:void(0);">2014年更早</a></li>
                    </ul>
                </div>
                <a data-v-bd62ee10="" href="javascript:void(0);" class="fl dum-title qv-dum-title">
                    我购买的作品 <em data-v-bd62ee10="">({$load['down']})</em></a>
            </div>
            <div data-v-bd62ee10="" class="user-box-row">
                {volist name="list" id="v"}
                <div data-v-bd62ee10="" class="user-box-list qt-card qv-card">
                    <div data-v-bd62ee10="" class="card-img"><a data-v-bd62ee10="" href="{:url('index/details/newpic',['id'=>$v['gid']])}" target="_blank">
                        <img data-v-bd62ee10="" src="http://pdyc9epam.bkt.clouddn.com/{$v['icon']}?imageMogr2/thumbnail/350x350>/gravity/Center/crop/247x220/format/jpg/blur/1x0/quality/75|imageslim" alt="">
                        <div data-v-bd62ee10="" class="card-bg"></div>
                    </a>
                    </div>
                    <div data-v-bd62ee10="" class="card-tag isYC isGX"></div>
                    <a data-v-bd62ee10="" href="#" target="_blank" class="card-title">{$v['downtime']|date="Y-m-d H:i:s",###}</a>
                </div>
                {/volist}
            </div>
            <div data-v-bd62ee10="" class="qv-pagination"><!----> <!----></div>
            <div class="el-loading-mask" style="display: none;">
                <div class="el-loading-spinner">
                    <svg viewBox="25 25 50 50" class="circular">
                        <circle cx="50" cy="50" r="20" fill="none" class="path"></circle>
                    </svg><!----></div>
            </div>
        </div>
        <!--下载默认隐藏部分-->

        <!--上传中间部分开始-->
        <div id="up" class="main-container favorite-main clearfix fr"><!---->
            <div  class="clearfix main-header">
                <a  href="{:url('index/upload/index')}" style="border-bottom:2px solid red" class="fl fav-title" >我的上传<em >({$load['up']})</em></a>
                <a  href="{:url('index/upload/waiting')}" class="fl fav-title ">待审核<em>({$load['check']})</em></a>
                <a  href="{:url('index/upload/passed')}" class="fl fav-title ">已通过<em >({$load['pass']})</em></a>
                <a  href="{:url('index/upload/up')}" class="fr  upload-btn">我要上传</a>
            </div>
            <div  class="upload-wrap draft"><p  class="upload-tip">请于上传之日起<span >9天</span>内完善图片信息并提交审核，否则素材将被删除</p>
                <ul  class="list-box"></ul>
                <!--可以循环部分-->
                <section>
                    <ul class="lb-album">
                        {volist name="data" id="v"  key="k"}
                        <li>
                            <a href="#image-{$k}" class="sbtn">
                                <img src="http://pdyc9epam.bkt.clouddn.com/{$v['icon']}?imageMogr2/thumbnail/350x350>/gravity/Center/crop/247x220/format/jpg/blur/1x0/quality/75|imageslim" alt="image{$k}" width="250" height="230">
                                <span>{$v['pname']}
                                    <button data-img="http://pdyc9epam.bkt.clouddn.com/{$v['icon']}" data-id="{$v['id']}" data-pname="{$v['desc']}" class="edit-btn lb-close btn-sm btn-info" style="position:absolute; right:0px; bottom:35px" data-toggle="modal" data-target="#myModal" >编辑</button>
                                    <button data-id="{$v['id']}" class="del-btn lb-close btn-sm btn-danger" style="position:absolute; right:0px; bottom:0px" data-name="{$v['uid']}">删除</button>
                                </span>
                            </a>
                            <div class="lb-overlay" id="image-{$k}">
                                <a href="#page" class="lb-close">Close</a>
                                <img src="http://pdyc9epam.bkt.clouddn.com/{$v['icon']}?imageMogr2/thumbnail/350x350>/gravity/Center/crop/247x220/format/jpg/blur/1x0/quality/75|imageslim" alt="image{$k}"   />
                                <div>
                                    <h3>{$v['desc']}</h3>
                                </div>
                            </div>
                        </li>

                        {/volist}
                    </ul>

                </section>
                <!--end可以循环部分-->
                {$page}

                <div  class="upload-null-alert" style="display:none">
                    <img src="http://icon.qiantucdn.com/images/uploads/upload-null.png" alt=""> <br >
                    <br>
                    <span  class="alert-text">您还没有上传作品，快去上传吧！</span> <br ><br >
                    <p  class="qt-btn btn-green-linear"><a  href="{:url('index/upload/up')}">立即上传</a></p>
                </div>
                <div class="" style="">
                    <div class="el-loading-spinner">
                        <circle cx="50" cy="50" r="20" fill="none" class="path"></circle>
                        </svg><!----></div>
                </div>
            </div>
        </div>
    </div>
</div>


<!-- 模态框-->


<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel"></h4>
            </div>
            <div class="modal-body">
                <!--表单开始-->
                <form class="form-inline" method="post" action="{:url('index/upload/doedit')}">
                    <div class="form-group">
                        <label for="exampleInputName2">原图片名</label>
                        <input class="oldname" type="text" name="oldname" class="form-control" id="exampleInputName2" value="" readonly>
                    </div>
                    <div class="form-group">
                        <label for="exampleInputEmail2">新图片名</label>
                        <input class="newname" type="text" name="newname" class="form-control" id="exampleInputEmail2" placeholder="请输入10字以为的名字" maxlength="10" value="">
                        <input class="oldid" type="hidden" value=""  name="id">
                    </div>
                    <!--END表单开始-->
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-primary mbtn">提交</button>
                <button type="button" class="btn btn-default mbtn" data-dismiss="modal">Close</button>
                </form>
            </div>
        </div>
    </div>
</div>
<!-- END模态框-->
{/block}

{block name="myjs"}
<script>
    $('#up-btn').click(function(){
        $('#up').show();
        $('#down').hide();
    })

    $('#down-btn').click(function(){
        $('#up').hide();
        $('#down').show();
    })

    $('.edit-btn').click(function(){
        var pname=$(this).attr('data-pname');
        var id=$(this).attr('data-id');
        $('.oldname').val(pname);
        $('.oldid').val(id);
    })



    $('.del-btn').click(function(){
        var id=$(this).attr('data-id');
        var li=$(this).parents('li');
        if(confirm("确定要[删除]此图片?"))
        {
            delAjax(id,li);
        }
        return false;
    })

    function delAjax(id,li){
        $.ajax({
            type:'delete',
            dataType:'json',
            url:'upload/'+id,
            success:function(data){
                if(data.status){
                    toastr.success('删除成功');
                    li.remove();
                }else{
                    toastr.error('删除失败');
                }
            },
            error:function(){

            }
        });
    }





</script>
{/block}